home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / comm / mail / YamBookToMD2.lha / YamBookToMD2.rexx < prev   
OS/2 REXX Batch file  |  1997-07-25  |  2KB  |  93 lines

  1. /*        Transfering YAM addressbook to MicroDotII                */
  2.  
  3. /* $VER: YamBookToMD2 1.0 (23.07.97) © By Patrick Wullaert.
  4.    Email : <patw@glo.be>  URL: http://titan.glo.be/patw/index.html */
  5. /*  Thanks to John Pullicino for testing ! :)  */
  6.  
  7. /* You need RexxReqTools.library in your LIBS: dir for this to work properly ! */
  8.  
  9.  
  10. /* This script can be used from either the shell (type 'rx <scriptpath>/yambooktoMD2.rexx) */
  11. /* or from within YAM (copy the script to the rexx drawer of the YAM dir and add this line */
  12. /* to the '.config' file :                                                                 */
  13. /* RexxMenu0 = YAM:Rexx/YamBooktoMD2.rexx  (where 0 is the menu item number)               */
  14.  
  15.  
  16. /* YAM is © By Marcel Beck.   MD2 is © By Oliver Wagner */
  17. /* RexxReqTools.library is © By Rafael D'Halleweyn      */
  18.  
  19.  
  20.  
  21. /* User definable paths start here : */
  22.  
  23. yampath='sdh0:Mailers/YAM/'
  24. mdpath='sdh0:newsreaders/MicroDotII/'
  25.  
  26. /* Mind the trailing slashes !! */
  27.  
  28. /* User definable paths end here */
  29.  
  30.  
  31.  
  32.  
  33. options results
  34.  
  35. addlib('rexxreqtools.library',0,-30,0)
  36.  
  37.    if show('P',YAM) then do
  38.    address YAM
  39.    INFO screen
  40.    pubscreen=result
  41.    end
  42.  
  43.  
  44. errorlin=""
  45.  
  46.    if ~open(yambook,yampath''.addressbook'',READ) then do
  47.    errorlin='Wrong YAM path !'
  48.    end
  49.    if ~open(mdbook,mdpath''MicroDot.Addressbook'',WRITE) then do
  50.    errorlin=errorlin' Wrong MD2 path !'
  51.    end
  52.  
  53.    if errorlin~=="" then do
  54.    errorlin=errorlin||'0A'x||'Please re-specify !'
  55.    rtezrequest(errorlin,,,'rt_pubscrname='||pubscreen)
  56.    exit
  57.    end
  58.  
  59.    writeln(mdbook,'MicroDot - Bookmarks.mcc')
  60.    close(mdbook)
  61.  
  62. open(mdbook,mdpath''MicroDot.Addressbook'',APPEND)
  63.  
  64. readln(yambook)
  65.  
  66. do until eof(yambook)
  67. lijn=readln(yambook)
  68.  
  69.    if pos('@GROUP',lijn)>0 then do
  70.    grp=substr(lijn,8)
  71.    writeln(mdbook,'»'||grp)
  72.    end
  73.  
  74.    if pos('@USER',lijn)>0 then do
  75.    adres=readln(yambook)
  76.    user=readln(yambook)
  77.    writeln(mdbook,user'|'adres)
  78.    end
  79.  
  80.    if pos('@ENDGROUP',lijn)>0 then do
  81.    writeln(mdbook,'«')
  82.    end
  83.  
  84.  
  85. end
  86.  
  87. close(mdbook)
  88. close(yambook)
  89.  
  90. rtezrequest('Your YAM addresses have been'||'0a'x||'copied to the MD2 addressbook !',,,'rt_pubscrname='||pubscreen)
  91.  
  92. exit
  93.